package com.example.smart.controller;

import com.aliyuncs.exceptions.ClientException;
import phoneyzm.service.YzmRedisService;
import com.example.common.util.R;
import com.example.smart.pojo.User;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Tag(name = "发送验证码")
public class YzmRedisController {
    @Autowired
    private YzmRedisService yzmRedisService;

    @Operation(summary = "验证码")
    @GetMapping(value = "/sendYzm")
    public R sendYzm(String userPhone) throws ClientException {
        User user = new User();
        user.setUserPhone(userPhone);
        return yzmRedisService.sendYzm(user);
    }
}
